<%= form_for [:admin, @product_supplement], :url => @product_supplement.new_record? ? admin_product_product_supplements_path(:product_id => params[:product_id]) : admin_product_product_supplement_path(:product_id => params[:product_id], :id => params[:id]), :validate => true do |f| %>

  <%= render "shared/error_messages", :target => @product_supplement %>

  <h2><%= @product_supplement.new_record? ? "Nová příloha" : "Editace přílohy \"#{@product_supplement.attachment_file_name}\"" %></h2>

  <table>
    <tbody>
      <% if @product_supplement.new_record? %>
      <tr>
        <th><%= f.label :attachment_file_name %></th>
        <td><%= f.file_field :attachment %></td>
        <td>Podporovaný formát: <strong>.PDF, .DOC, .TXT, .PPT, .XLS, .PNG, .JPG, .GIF)</strong></td>
      </tr>
      <% end %>
      <tr>
        <th><%= f.label :name %></th>
        <td colspan="2"><%= f.text_field :name, :maxlength => 100, :size => 50 %></td>
      </tr>
      <tr>
        <th><%= f.label :description %></th>
        <td colspan="2"><%= f.text_field :description, :maxlength => 250, :size => 100 %></td>
      </tr>
      <tr>
        <td colspan="3"><%= f.submit %></td>
      </tr>
    </tbody>
  </table>
<% end %>